﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Agile.Manager.UI.Windows.ViewModel;
using Agile.Manager.Windows.Model;

namespace Agile.Manager.Windows.View
{
    /// <summary>
    /// Interaction logic for TaskView.xaml
    /// </summary>
    public partial class TaskView : UserControl
    {
        TaskViewModel tVM;
        public TaskView()
        {
            InitializeComponent();

            if (tVM == null)
                tVM = new TaskViewModel();

            DataContext = tVM;
        }

        private void TreeTask_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            TreeView tvi = sender as TreeView;
            if (tvi != null)
            {
                tVM.SelectedTask = tvi.SelectedItem as Task;
            }
        }
    }
}
